package com.gaoxiang.demo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.util.List;

@RestController
public class ConsumeController {
    @Autowired
    RestTemplate restTemplate;
    @GetMapping("/consume")
    public List<String> method(){
        return  restTemplate.getForObject("http://localhost:8081/name",List.class);
    }
}
